package BehaviorModel.commandModel;

/**
 * 功能描述: 电灯开启
 * 2024/02/14
 *
 * @see Command
 * ZhangYi
 */
public class LightOnCommand implements Command{

    private LightReceive lightResever;

    /**
     * 功能描述: 构造器的方式注入 LightResever 真实执行的对象
     *
     * @param lightResever
     * @return
     */
    public LightOnCommand(LightReceive lightResever) {
        this.lightResever = lightResever;
    }

    /**
     * 功能描述: 执行命令
     */
    @Override
    public void execute() {
        lightResever.on();
    }

    /**
     * 功能描述: 取消命令
     */
    @Override
    public void undo() {
        lightResever.off();
    }
}
